﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.ISerivces;
using DWF.Studio.ScriptEngine;
using DWF.Studio.ScriptEngine.IPC.Msg;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.Script.Excutor
{
    /// <summary>
    /// 引擎IPC服务
    /// </summary>
    internal class ScriptEngineIPCService : IScriptEngineIPCService
    {
        private ISerivces.IEngineIPCService _engineIPCService = null;

        public ScriptEngineIPCService(IEngineIPCService engineIPCService)
        {
            _engineIPCService = engineIPCService;
        }

        public void AddReceiveAction(Action<UpwardMsg> action)
        {
            _engineIPCService.AddReceiveAction(action);
        }

        public string GetPipeName()
        {
            return _engineIPCService.GetPipeName();
        }

        public void RemoveReceiveAction(Action<UpwardMsg> action)
        {
            _engineIPCService.RemoveReceiveAction(action);
        }

        public void Send(DownwardMsg msg)
        {
            _engineIPCService.Send(msg);
        }
    }
}
